﻿using System.Windows.Controls;
using System.Windows.Navigation;

namespace SilverlightTetris_M10CDE.Views
{
    public partial class Highscores : Page
    {
        //private TetrisGameService. service = new TetrisGameService.TetrisServiceSoapClient();
        public Highscores()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var client = new TetrisRef.TetrisServiceSoapClient();

            client.getHighScoresCompleted += (sender, ea) =>
            {
                highScores_dataGrid.AutoGenerateColumns = true;
                highScores_dataGrid.ItemsSource = ea.Result;
            };

            client.getHighScoresAsync();
        }
    }
}
